import { createApp } from 'vue'
import App from './App.vue'

import router from './router'
import { createPinia } from 'pinia'
import Hello from './components/Hello.vue'
const app = createApp(App)

app.use(router)
app.use(createPinia())
// 注册全局组件，这样就可以在任何地方使用 <Hello /> 组件,不需要单独引入
app.component('Hello', Hello)

// <h1>{{ $filters.uppercase(msg) }}</h1>
app.config.globalProperties.$filters = {
  uppercase(value: string) {
    return value.toUpperCase()
  }
}
// 这里是全局属性 vx
app.config.globalProperties.vx='hello vx'

declare module 'vue'{
    interface ComponentCustomProperties{
        $filters:{
            uppercase(value: string): string
        },
        vx: string
    }
}
app.mount('#app')
